package com.ruoyi.cmecomon.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cmecomon.mapper.ZxOrderPostmanMapper;
import com.ruoyi.cmecomon.domain.ZxOrderPostman;
import com.ruoyi.cmecomon.service.IZxOrderPostmanService;

/**
 * orderpostmanService业务层处理
 * 
 * @author zhangxu
 * @date 2022-02-24
 */
@Service
public class ZxOrderPostmanServiceImpl implements IZxOrderPostmanService 
{
    @Autowired
    private ZxOrderPostmanMapper zxOrderPostmanMapper;




    /**
     * 查询orderpostman
     * 
     * @param orderId orderpostman主键
     * @return orderpostman
     */
    @Override
    public ZxOrderPostman selectZxOrderPostmanByOrderId(String orderId)
    {
        return zxOrderPostmanMapper.selectZxOrderPostmanByOrderId(orderId);
    }

    @Override
    public List<Integer> selectOrderPostmenDictByOrderId(String orderId) {

        List<Integer> dicts = new ArrayList<>();

        List<ZxOrderPostman> zxOrderPostmen = zxOrderPostmanMapper.selectZxOrderPostmenByOrderId(orderId);
        for (ZxOrderPostman zxOrderPostman : zxOrderPostmen) {
            dicts.add(zxOrderPostman.getDictValue());
        }

        return dicts;
    }

    /**
     * 查询orderpostman列表
     * 
     * @param zxOrderPostman orderpostman
     * @return orderpostman
     */
    @Override
    public List<ZxOrderPostman> selectZxOrderPostmanList(ZxOrderPostman zxOrderPostman)
    {
        return zxOrderPostmanMapper.selectZxOrderPostmanList(zxOrderPostman);
    }

    /**
     * 新增orderpostman
     * 
     * @param zxOrderPostman orderpostman
     * @return 结果
     */
    @Override
    public int insertZxOrderPostman(ZxOrderPostman zxOrderPostman)
    {
        return zxOrderPostmanMapper.insertZxOrderPostman(zxOrderPostman);
    }

    /**
     * 修改orderpostman
     * 
     * @param zxOrderPostman orderpostman
     * @return 结果
     */
    @Override
    public int updateZxOrderPostman(ZxOrderPostman zxOrderPostman)
    {
        return zxOrderPostmanMapper.updateZxOrderPostman(zxOrderPostman);
    }

    /**
     * 批量删除orderpostman
     * 
     * @param orderIds 需要删除的orderpostman主键
     * @return 结果
     */
    @Override
    public int deleteZxOrderPostmanByOrderIds(String[] orderIds)
    {
        return zxOrderPostmanMapper.deleteZxOrderPostmanByOrderIds(orderIds);
    }

    /**
     * 删除orderpostman信息
     * 
     * @param orderId orderpostman主键
     * @return 结果
     */
    @Override
    public int deleteZxOrderPostmanByOrderId(String orderId)
    {
        return zxOrderPostmanMapper.deleteZxOrderPostmanByOrderId(orderId);
    }
}
